package com.example.traning.mall.controller.account;

import com.example.traning.mall.framework.common.pojo.PageParam;
import com.example.traning.mall.framework.common.pojo.R;
import com.example.traning.mall.service.account.IAccountLoginLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import lombok.RequiredArgsConstructor;

/**
 * <p>
 * 用户登录日志 前端控制器
 * </p>
 *
 * @author Lei Yu
 * @since 2025-04-29
 */
@Tag(name = "2. 登录日志")
@RequiredArgsConstructor
@RestController
@RequestMapping("/login-logs")
public class AccountLoginLogController {

    private final IAccountLoginLogService iAccountLoginLogService;

    @GetMapping("")
    @PreAuthorize("hasAuthority('/account/user/query')")
    @Operation(summary = "查询登录日志列表")
    public R selectPage(PageParam page) {
        return R.ok(iAccountLoginLogService.selectPage(page));
    }

}
